<?php
Yii::import('zii.widgets.CPortlet');
class UserLogin extends CPortlet
{
    public $title='Login';
 
    protected function renderContent()
    {
        $form=new LoginForm;
        $this->contentCssClass='input';
        if(isset($_POST['LoginForm']))
        {
        	//print_r($_POST['LoginForm']);exit;
            $form->attributes=$_POST['LoginForm'];
            if($form->validate() && $form->login())
                  //$this->redirect(Yii::app()->user->returnUrl);
                    $this->controller->refresh();
        }
        $this->render('userLogin',array('form'=>$form));
    }
}